import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);

const routes = [
  {
    path: '/home',
    name: 'Home',
    component:() => import( '../views/Home.vue'),
    children:[
      {
        path:'/userInfo',
        name:"UserInfo",
        component:() => import( '../views/home/UserInfo.vue'),
      },
      {
        path:'/stuInfo',
        name:"StuInfo",
        component:() => import( '../views/home/StuInfo.vue'),
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import( '../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import( '../views/Register.vue')
  },
  {
    path: '/',
    redirect:'/login'
  }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});

export default router
